<?php

class Sgit_Form_Element_Fecha extends Zend_Form_Element_Text
{
    
    public function init()
    {

       $this->setAttrib('class','fecha')->addFilters(array('Null','StringTrim'));
            
            
       if(LOCALE=='es'){
            $validator = new Zend_Validate_Date(array('format' => 'dd-MM-yyyy'));
            $this->addValidator($validator);
       } 
       if(LOCALE=='en'){
            $validator = new Zend_Validate_Date(array('format' => 'yyyy-MM-dd'));  
            $this->addValidator($validator);   
       } 
            
    }
}
